/*
 * @Author: 周海 zhouhaib@yonyou.com
 * @Date: 2022-11-16 21:10:45
 * @LastEditors: Zhouhai 497675647@qq.com
 * @LastEditTime: 2022-11-21 15:41:43
 */
import { SysRoleUserDomain } from '@/type.d/system/roleUser'
import request from '@/utils/request'

// 查询用户和角色关联列表
export function listRoleUser(query: SysRoleUserDomain) {
  return request('/system/roleuser/list',{
    method: 'get',
    params: query
  })
}

// 查询用户和角色关联详细
export function getRoleUser(userId: string) {
  return request('/system/roleuser/' + userId,{
    method: 'get'
  })
}

// 新增用户和角色关联
export function addRoleUser(data: SysRoleUserDomain[]) {
  return request('/system/roleuser',{
    method: 'post',
    data: data
  })
}

// 修改用户和角色关联
export function updateRoleUser(data: SysRoleUserDomain) {
  return request('/system/roleuser',{
    method: 'put',
    data: data
  })
}

// 删除用户和角色关联
export function delRoleUser(roleUserId: string) {
  return request('/system/roleuser/rolePostIds/' + roleUserId,{
    method: 'delete'
  })
}

// 根据角色id删除用户和角色关联
export function delRoleUserByRoleId(roleId: string) {
  return request('/system/roleuser/roleId/' + roleId,{
    method: 'delete'
  })
}